package com.dabai.iot.core.tsl.specs;

import com.alibaba.fastjson2.annotation.JSONField;
import com.dabai.iot.core.entity.ThingModelItemEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class TslTextSpec implements TslDataSpec {

	/**
	 * 字符串长度
	 */
	@Schema(description = "字符串长度")
	@JSONField(ordinal = 1)
	private Integer textLength;

	@Override
	public TslTextSpec createSpec(ThingModelItemEntity item) {
		TslTextSpec spec = new TslTextSpec();
		spec.setTextLength(item.getTextLength());
		return spec;
	}

}
